$(document).ready(function() {
    $('#queryForm').submit(function(event) {
        event.preventDefault();

        var mac = $('#mac').val();
        var ip = $('#ip').val();

        var action = ipList[ip] || '';

        $('#resultArea').html('<pre>正在查询，请稍后...</pre>');

        $.ajax({
            url: action,
            method: 'POST',
            data: {
                mac: mac,
                ip: ip
            },
            success: function(result) {
                $('#resultArea').html('<pre>' + result + '</pre>');
            }
        });
    });
});
